package com.demo2do.fms.entity.vehicle.tractor;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.fms.entity.authority.Organization;
import com.demo2do.fms.entity.supplier.common.Supplier;
import com.demo2do.fms.entity.vehicle.AssetStatus;
import com.demo2do.fms.entity.vehicle.AuditStatus;
import com.demo2do.fms.entity.vehicle.DeclareStatus;
import com.demo2do.fms.entity.vehicle.VehicleStatus;

/**
 * 牵引车
 * 
 * @author Wy
 *
 */
@Entity
@Table(name = "FMS_TRACTOR")
@DynamicInsert
@DynamicUpdate
public class Tractor {
    
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "generator")
    @SequenceGenerator(name = "generator", sequenceName = "HIBERNATE_SEQUENCE", allocationSize = 1)
    private Long id;
    
    /** 所属公司 */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "organization_id", referencedColumnName = "id")
    private Organization organization;

    /** 所属供方 */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "supplier_id", referencedColumnName = "id")
    private Supplier supplier;
    
    /** 车辆编号 */
    private String code;

    /** 中文牌号 */
    @Column(name = "BRAND_CN_CODE")
    private String brandCNCode;

    /** 英文牌号 */
    @Column(name = "BRAND_EN_CODE")
    private String brandENCode;
    
    /** VIN码 */
    @Column(name = "VIN")
    private String vincode;
    
    /** 产证所有者 */
    private String floorLord;

    /** 品牌 */
    private String brand;
    
    /** 车辆所属权 */
    @Enumerated(EnumType.STRING)
    private CarOwnership carOwnership;

    /** 运输工具类型  */
    @Enumerated(EnumType.STRING)
    private TransMean transMean;
    
    /** 车辆类型（行驶证） */
    @Enumerated(EnumType.STRING)
    private TractorVehicleType vehicleType;

    /** GPS品牌 */
    private String gps;

    /** GPS绑定SIM卡 */
    private String simCard;
    
    /** 马力 */
    private BigDecimal horsepower;
    
    /** 轴数 */
    private BigDecimal axles;
    
    /** 装载量 */
    private BigDecimal trainload;

    /** 发证时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date issuingTime;
    
    /** 注册时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date registrationTime;
    
    /** 年检有效期至 */
    @DateTimeFormat(pattern = "yyyy-MM")
    private Date annualInspectionDate;

    /** 行驶证 */
    private String drivingLicense;

    /** 行驶证副本及检验页扫描件 */
    private String drivingLicenseCopy;

    /** 45度角照片 */
    private String vehiclePhoto;

    /** 购车合同 */
    private String vehicleContact;
    
    /** 审核状态 */
    @Enumerated(EnumType.STRING)
    private AuditStatus status;
    
    /** 车辆状态 */
    @Enumerated(EnumType.STRING)
    private VehicleStatus vehicleStatus;
    
    /** 引入申报时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date declareTime;

    /** 引入申报状态 */
    @Enumerated(EnumType.STRING)
    private DeclareStatus declareStatus;
    
    /** 驳回理由 */
    private String rejectReason;
    
    /** 是否同步TMS */
    @Column(name = "is_synchronize")
    private boolean synchronize;
    
    /** 是否绑定挂车 */
    @Column(name = "is_bind")
    private boolean bind;

    /** VAM车辆id */
    private Long vamId;
    
    /** 资产状态， 只存在VAM车辆中 */
    @Enumerated(EnumType.STRING)
    private AssetStatus assetStatus;

    /** 是否是VAM引入车辆 */
    @Column(name = "is_vam")
    private boolean vam;

    /** 创建者 */
    @Column(name = "CREATOR")
    private Long creator;

    /** 创建时间 */
    @Column(name = "CREATE_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 最近修改者 */
    @Column(name = "LAST_OPERATOR")
    private Long lastOperator;

    /** 最近修改时间 */
    @Column(name = " LAST_MODIFY_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastModifyTime;

    @Column(name = "IS_DISABLED")
    private Boolean disabled;

    /**
     * The default constructor
     */
    public Tractor() {
    }
    
    /**
     * 创建FMS车辆
     * 
     * @param floorLord
     * @param carOwnership
     * @param transMean
     * @param brandCNCode
     * @param brandENCode
     * @param vincode
     * @param brand
     * @param horsepower
     * @param gps
     * @param simCard
     * @param issuingTime
     * @param registrationTime
     * @param axles
     * @param annualInspectionDate
     * @param trainload
     * @param organization
     * @param supplier
     * @param operator
     */
    public Tractor(String floorLord, CarOwnership carOwnership, TransMean transMean, String brandCNCode, String brandENCode,
            String vincode, String brand, BigDecimal horsepower, String gps, String simCard, Date issuingTime,
            Date registrationTime, BigDecimal axles, Date annualInspectionDate, BigDecimal trainload, TractorVehicleType vehicleType,
            Organization organization, Supplier supplier, Long operator) {
        
        this.floorLord = floorLord;
        this.carOwnership = carOwnership;
        this.transMean = transMean;
        this.brandCNCode = brandCNCode;
        this.brandENCode = brandENCode;
        this.vincode = vincode;
        this.brand = brand;
        this.gps = gps;
        this.simCard = simCard;
        this.horsepower = horsepower;
        this.axles = axles;
        this.issuingTime = issuingTime;
        this.registrationTime = registrationTime;
        this.annualInspectionDate = annualInspectionDate;
        this.trainload = trainload;
        this.vehicleType = vehicleType;
        
        this.status = AuditStatus.EDITING;
        this.vehicleStatus = VehicleStatus.NORMAL;
        this.declareStatus = DeclareStatus.UNSYNC;
        
        this.organization = organization;
        this.supplier = supplier;
        
        this.bind = false;
        this.synchronize = false;
        this.vam = false;
        
        this.creator = operator;
        this.createTime = new Date();
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        this.disabled = false;
    }

    /**
     * @param floorLord
     * @param carOwnership
     * @param transMean
     * @param brandCNCode
     * @param brandENCode
     * @param vincode
     * @param brand
     * @param horsepower
     * @param issuingTime
     * @param registrationTime
     * @param axles
     * @param annualInspectionDate
     * @param trainload
     * @param vehicleType
     * @param organization
     * @param supplier
     * @param operator
     */
    public Tractor(String floorLord, CarOwnership carOwnership, TransMean transMean, String brandCNCode, String brandENCode,
                   String vincode, String brand, BigDecimal horsepower, Date issuingTime,
                   Date registrationTime, BigDecimal axles, Date annualInspectionDate, BigDecimal trainload, TractorVehicleType vehicleType,
                   Organization organization, Supplier supplier, Long operator) {

        this.floorLord = floorLord;
        this.carOwnership = carOwnership;
        this.transMean = transMean;
        this.brandCNCode = brandCNCode;
        this.brandENCode = brandENCode;
        this.vincode = vincode;
        this.brand = brand;
        this.horsepower = horsepower;
        this.axles = axles;
        this.issuingTime = issuingTime;
        this.registrationTime = registrationTime;
        this.annualInspectionDate = annualInspectionDate;
        this.trainload = trainload;
        this.vehicleType = vehicleType;

        this.status = AuditStatus.EDITING;
        this.vehicleStatus = VehicleStatus.NORMAL;
        this.declareStatus = DeclareStatus.UNSYNC;

        this.organization = organization;
        this.supplier = supplier;

        this.bind = false;
        this.synchronize = false;
        this.vam = false;

        this.creator = operator;
        this.createTime = new Date();
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        this.disabled = false;
    }

    /**
     * 创建VAM车辆
     * 
     * @param floorLord
     * @param carOwnership
     * @param transMean
     * @param brandCNCode
     * @param brandENCode
     * @param vincode
     * @param brand
     * @param horsepower
     * @param gps
     * @param simCard
     * @param issuingTime
     * @param registrationTime
     * @param axles
     * @param annualInspectionDate
     * @param trainload
     * @param vehicleType
     * @param organization
     * @param supplier
     * @param assetStatus
     * @param vamId
     * @param creator
     */
    public Tractor(String floorLord, CarOwnership carOwnership, TransMean transMean, String brandCNCode, String brandENCode,
            String vincode, String brand, BigDecimal horsepower, String gps, String simCard, Date issuingTime,
            Date registrationTime, BigDecimal axles, Date annualInspectionDate, BigDecimal trainload, TractorVehicleType vehicleType,
            String drivingLicense, String drivingLicenseCopy, String vehiclePhoto, String vehicleContact,
            Organization organization, Supplier supplier, AssetStatus assetStatus, Long vamId, Long creator, Long lastOperator) {
        
        this.floorLord = floorLord;
        this.carOwnership = carOwnership;
        this.transMean = transMean;
        this.brandCNCode = brandCNCode;
        this.brandENCode = brandENCode;
        this.vincode = vincode;
        this.brand = brand;
        this.gps = gps;
        this.simCard = simCard;
        this.horsepower = horsepower;
        this.axles = axles;
        this.issuingTime = issuingTime;
        this.registrationTime = registrationTime;
        this.annualInspectionDate = annualInspectionDate;
        this.trainload = trainload;
        this.vehicleType = vehicleType;
        this.drivingLicense = drivingLicense;
        this.drivingLicenseCopy = drivingLicenseCopy;
        this.vehiclePhoto = vehiclePhoto;
        this.vehicleContact = vehicleContact;
        
        this.status = AuditStatus.AUDITING;
        this.vehicleStatus = VehicleStatus.NORMAL;
        this.declareStatus = DeclareStatus.UNSYNC;
        this.declareTime = new Date();
        this.rejectReason = null;
        
        this.organization = organization;
        this.supplier = supplier;
        
        this.assetStatus = assetStatus;
        this.vamId = vamId;
        
        this.bind = false;
        this.synchronize = false;
        this.vam = true;
        
        this.creator = creator;
        this.createTime = new Date();
        this.lastOperator = lastOperator;
        this.lastModifyTime = new Date();
        this.disabled = false;
    }
    
    /**
     * @param organization
     * @param supplier
     * @param createTime
     * @param creator
     * @return
     */
    public Tractor initialize(Organization organization, Supplier supplier, Date createTime, Long creator) {
        
        this.status = AuditStatus.EDITING;
        this.vehicleStatus = VehicleStatus.NORMAL;
        this.declareStatus = DeclareStatus.UNSYNC;
        
        this.organization = organization;
        this.supplier = supplier;
        
        this.bind = false;
        this.synchronize = false;
        this.vam = false;
        
        this.creator = creator;
        this.createTime = createTime;
        this.lastOperator = creator;
        this.lastModifyTime = createTime;
        this.disabled = false;
        
        return this;
        
    }
    
    /**
     * @param code
     * @return  
     */
    public Tractor editCode(String code) {
        this.code = code;
        return this;
    }
    
    /**
     * VAM更新车辆
     * 
     * @param tractor
     * @return
     */
    public Tractor edit(Tractor tractor) {
        this.brandCNCode = tractor.getBrandCNCode();
        this.brandENCode = tractor.getBrandENCode();
        this.brand = tractor.getBrand();
        this.vincode = tractor.getVincode();
        this.issuingTime = tractor.getIssuingTime();
        this.registrationTime = tractor.getRegistrationTime();
        this.axles = tractor.getAxles();
        this.annualInspectionDate = tractor.getAnnualInspectionDate();
        this.horsepower = tractor.getHorsepower();
        this.floorLord = tractor.floorLord;
        this.transMean = tractor.transMean;
        this.trainload = tractor.getTrainload();
        this.vehicleType = tractor.getVehicleType();
        this.drivingLicense = tractor.getDrivingLicense();
        this.drivingLicenseCopy = tractor.getDrivingLicenseCopy();
        this.vehiclePhoto = tractor.getVehiclePhoto();
        this.vehicleContact = tractor.getVehicleContact();
        
        this.gps = tractor.getGps();
        this.simCard = tractor.getSimCard();
        this.assetStatus = tractor.getAssetStatus();
        return this;
    }
    
    /**
     * VAM更新合格车辆
     * 
     * @param tractor
     * @return
     */
    public Tractor editQualifiedField(Tractor tractor) {
        this.brandCNCode = tractor.getBrandCNCode();
        this.brandENCode = tractor.getBrandENCode();
        this.transMean = tractor.transMean;
        this.trainload = tractor.getTrainload();
        this.gps = tractor.getGps();
        this.simCard = tractor.getSimCard();
        this.assetStatus = tractor.getAssetStatus();
        return this;
    }
    
    /**
     * @return
     */
    public Tractor sign() {
        this.synchronize = true;
        return this;
    }
    
    /**
     * @param code
     * @return
     */
    public Tractor sign(String code) {
        this.code = code;
        this.synchronize = true;
        return this;
    }
    
    /**
     * @return
     */
    public String auditMessage() {
        
        if (supplier == null) {
            return "运输公司未录入";
        } else if (StringUtils.isBlank(floorLord)) {
            return "产证所有者未录入";
        } else if (StringUtils.isBlank(brandCNCode)) {
            return "中文牌号未录入";
        } else if (StringUtils.isBlank(brandENCode)) {
            return "英文牌号未录入";
        } else if (StringUtils.isBlank(brand)) {
            return "品牌未录入";
        } else if (StringUtils.isBlank(vincode)) {
            return "VIN码未录入";
        } else if (carOwnership == null) {
            return "车辆所属权未录入";
        } else if (transMean == null) {
            return "运输工具类型未录入";
        } else if (horsepower == null) {
            return "马力未录入";
        } else if (axles == null) {
            return "轴数未录入";
        } else if (issuingTime == null) {
            return "发证日期未录入";
        } else if (registrationTime == null) {
            return "注册时间未录入";
        } else if (annualInspectionDate == null) {
            return "年检有效期未录入";
        } else if (status == null) {
            return "车辆审核状态未初始化";
        } else if (vehicleStatus == null) {
            return "车辆状态未录入";
        } else if (vehicleType == null) {
            return "车辆类型（行驶证）未录入";
        } else if (StringUtils.isBlank(drivingLicense)) {
            return "行驶证原件扫描件未录入";
        } else if (StringUtils.isBlank(drivingLicenseCopy)) {
            return "行驶证副本及检验页扫描件未录入";
        } else if (StringUtils.isBlank(vehiclePhoto)) {
            return "车头45度角照片未上传";
        } else {
            return null;
        }
        
    }
    
    /**
     * @param operator
     * @return
     */
    public Tractor audit(Long operator) {
        
        if (declareStatus.isModified()) {
            this.status = AuditStatus.MODIFIED;
        } else {
            this.status = AuditStatus.AUDITING;
        }
        
        this.declareTime = new Date();
        this.rejectReason = null;
        
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * 引入申报  - 审核通过
     * 
     * @param operator
     * @return
     */
    public Tractor adoptAuditing(Long operator) {
        this.status = AuditStatus.QUALIFIED;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * 引入申报 - 审核驳回
     * 
     * @param operator
     * @return
     */
    public Tractor rejectAuditing(Long operator) {
        this.status = AuditStatus.REJECTED;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * @param operator
     * @return
     */
    public Tractor change(Long operator) {
        this.status = AuditStatus.MODIFIED;
        this.declareStatus = DeclareStatus.MODIFIED;
        this.declareTime = new Date();
        this.rejectReason = null;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * 变更审核 - 通过
     * 
     * @param version
     * @param operator
     * @return
     */
    public Tractor adoptModified(TractorModifiedVersion version, Long operator) {
        
        this.floorLord = version.getFloorLord();
        this.carOwnership = version.getCarOwnership();
        this.vincode = version.getVincode();
        this.brand = version.getBrand();
        this.issuingTime = version.getIssuingTime();
        this.horsepower = version.getHorsepower();
        this.registrationTime = version.getRegistrationTime();
        this.annualInspectionDate = version.getAnnualInspectionDate();
        this.axles = version.getAxles();
        this.trainload = version.getTrainload();
        this.vehicleType = version.getVehicleType();
        
        if (StringUtils.isNotBlank(version.getDrivingLicense())) {
            this.drivingLicense = version.getDrivingLicense();
        }
        if (StringUtils.isNotBlank(version.getDrivingLicenseCopy())) {
            this.drivingLicenseCopy = version.getDrivingLicenseCopy();
        }
        if (StringUtils.isNotBlank(version.getVehiclePhoto())) {
            this.vehiclePhoto = version.getVehiclePhoto();
        }
        if (StringUtils.isNotBlank(version.getVehicleContact())) {
            this.vehicleContact = version.getVehicleContact();
        }
        
        this.status = AuditStatus.QUALIFIED;
        this.rejectReason = null;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        
        return this;
        
    }
    
    /**
     * 转籍
     * 
     * @param supplier
     * @param operator
     * @return
     */
    public Tractor transfer(Supplier supplier, Organization organization, Long operator) {
        this.supplier = supplier;
        this.organization = organization;
        this.bind = false;
        this.status = AuditStatus.EDITING;
        this.declareStatus = DeclareStatus.UNSYNC;
        this.declareTime = null;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * @param supplier
     * @param organization
     * @param operator
     * @return
     */
    public Tractor transferForVam(Supplier supplier, Organization organization, Long operator) {
        this.supplier = supplier;
        this.organization = organization;
        this.bind = false;
        this.status = AuditStatus.AUDITING;
        this.declareStatus = DeclareStatus.UNSYNC;
        this.declareTime = null;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * 必须绑挂车
     * 
     * @return
     */
    public boolean requireTrailer() {
        return trainload == null || trainload.intValue() <= 0;
    }
    
    /**
     * @return
     */
    public Tractor bind() {
        this.bind = true;
        return this;
    }
    
    /**
     * @return
     */
    public Tractor unbind() {
        this.bind = false;
        return this;
    }
    
    /**
     * @param operator
     * @return
     */
    public Tractor out(Long operator) {
        this.disabled = true;
        this.bind = false;
        this.vehicleStatus = VehicleStatus.OUT;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * @return
     */
    public Tractor disable(Long operator) {
        this.disabled = true;
        this.lastOperator = operator;
        this.lastModifyTime = new Date();
        return this;
    }
    
    /**
     * @param status
     * @return
     */
    public Tractor status(AuditStatus status) {
        this.status = status;
        return this;
    }

    /**
     * @param lastModifyTime
     * @param lastOperator
     * @return
     */
    public Tractor operate(Date lastModifyTime, Long lastOperator) {
        this.lastModifyTime = lastModifyTime;
        this.lastOperator = lastOperator;
        return this;
    }

    /**
    * @description 锁车成功车辆改为未审核
    * @params []
    * @return com.demo2do.fms.entity.vehicle.tractor.Tractor
    * @author LZJ
    * @date 2020/12/2 16:42
    **/
    public Tractor makeStatusToAuditing(){
        this.status = AuditStatus.AUDITING;
        this.lastModifyTime = new Date();
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the organization
     */
    public Organization getOrganization() {
        return organization;
    }

    /**
     * @return the supplier
     */
    public Supplier getSupplier() {
        return supplier;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @return the brandCNCode
     */
    public String getBrandCNCode() {
        return brandCNCode;
    }

    /**
     * @return the brandENCode
     */
    public String getBrandENCode() {
        return brandENCode;
    }

    /**
     * @return the vincode
     */
    public String getVincode() {
        return vincode;
    }

    /**
     * @return the floorLord
     */
    public String getFloorLord() {
        return floorLord;
    }

    /**
     * @return the brand
     */
    public String getBrand() {
        return brand;
    }

    /**
     * @return the carOwnership
     */
    public CarOwnership getCarOwnership() {
        return carOwnership;
    }

    /**
     * @return the transMean
     */
    public TransMean getTransMean() {
        return transMean;
    }

    /**
     * @return the vehicleType
     */
    public TractorVehicleType getVehicleType() {
        return vehicleType;
    }

    /**
     * @return the gps
     */
    public String getGps() {
        return gps;
    }

    /**
     * @return the simCard
     */
    public String getSimCard() {
        return simCard;
    }

    /**
     * @return the horsepower
     */
    public BigDecimal getHorsepower() {
        return horsepower;
    }

    /**
     * @return the axles
     */
    public BigDecimal getAxles() {
        return axles;
    }

    /**
     * @return the trainload
     */
    public BigDecimal getTrainload() {
        return trainload;
    }

    /**
     * @return the issuingTime
     */
    public Date getIssuingTime() {
        return issuingTime;
    }

    /**
     * @return the registrationTime
     */
    public Date getRegistrationTime() {
        return registrationTime;
    }

    /**
     * @return the annualInspectionDate
     */
    public Date getAnnualInspectionDate() {
        return annualInspectionDate;
    }

    /**
     * @return the drivingLicense
     */
    public String getDrivingLicense() {
        return drivingLicense;
    }

    /**
     * @return the drivingLicenseCopy
     */
    public String getDrivingLicenseCopy() {
        return drivingLicenseCopy;
    }

    /**
     * @return the vehiclePhoto
     */
    public String getVehiclePhoto() {
        return vehiclePhoto;
    }

    /**
     * @return the vehicleContact
     */
    public String getVehicleContact() {
        return vehicleContact;
    }

    /**
     * @return the status
     */
    public AuditStatus getStatus() {
        return status;
    }

    /**
     * @return the vehicleStatus
     */
    public VehicleStatus getVehicleStatus() {
        return vehicleStatus;
    }

    /**
     * @return the declareTime
     */
    public Date getDeclareTime() {
        return declareTime;
    }

    /**
     * @return the declareStatus
     */
    public DeclareStatus getDeclareStatus() {
        return declareStatus;
    }

    /**
     * @return the rejectReason
     */
    public String getRejectReason() {
        return rejectReason;
    }

    /**
     * @return the synchronize
     */
    public boolean isSynchronize() {
        return synchronize;
    }

    /**
     * @return the bind
     */
    public boolean isBind() {
        return bind;
    }

    /**
     * @return the vamId
     */
    public Long getVamId() {
        return vamId;
    }

    /**
     * @return the assetStatus
     */
    public AssetStatus getAssetStatus() {
        return assetStatus;
    }

    /**
     * @return the vam
     */
    public boolean isVam() {
        return vam;
    }

    /**
     * @return the creator
     */
    public Long getCreator() {
        return creator;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the lastOperator
     */
    public Long getLastOperator() {
        return lastOperator;
    }

    /**
     * @return the lastModifyTime
     */
    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    /**
     * @return the disabled
     */
    public Boolean getDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param organization the organization to set
     */
    public void setOrganization(Organization organization) {
        this.organization = organization;
    }

    /**
     * @param supplier the supplier to set
     */
    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @param brandCNCode the brandCNCode to set
     */
    public void setBrandCNCode(String brandCNCode) {
        this.brandCNCode = brandCNCode;
    }

    /**
     * @param brandENCode the brandENCode to set
     */
    public void setBrandENCode(String brandENCode) {
        this.brandENCode = brandENCode;
    }

    /**
     * @param vincode the vincode to set
     */
    public void setVincode(String vincode) {
        this.vincode = vincode;
    }

    /**
     * @param floorLord the floorLord to set
     */
    public void setFloorLord(String floorLord) {
        this.floorLord = floorLord;
    }

    /**
     * @param brand the brand to set
     */
    public void setBrand(String brand) {
        this.brand = brand;
    }

    /**
     * @param carOwnership the carOwnership to set
     */
    public void setCarOwnership(CarOwnership carOwnership) {
        this.carOwnership = carOwnership;
    }

    /**
     * @param transMean the transMean to set
     */
    public void setTransMean(TransMean transMean) {
        this.transMean = transMean;
    }

    /**
     * @param vehicleType the vehicleType to set
     */
    public void setVehicleType(TractorVehicleType vehicleType) {
        this.vehicleType = vehicleType;
    }

    /**
     * @param gps the gps to set
     */
    public void setGps(String gps) {
        this.gps = gps;
    }

    /**
     * @param simCard the simCard to set
     */
    public void setSimCard(String simCard) {
        this.simCard = simCard;
    }

    /**
     * @param horsepower the horsepower to set
     */
    public void setHorsepower(BigDecimal horsepower) {
        this.horsepower = horsepower;
    }

    /**
     * @param axles the axles to set
     */
    public void setAxles(BigDecimal axles) {
        this.axles = axles;
    }

    /**
     * @param trainload the trainload to set
     */
    public void setTrainload(BigDecimal trainload) {
        this.trainload = trainload;
    }

    /**
     * @param issuingTime the issuingTime to set
     */
    public void setIssuingTime(Date issuingTime) {
        this.issuingTime = issuingTime;
    }

    /**
     * @param registrationTime the registrationTime to set
     */
    public void setRegistrationTime(Date registrationTime) {
        this.registrationTime = registrationTime;
    }

    /**
     * @param annualInspectionDate the annualInspectionDate to set
     */
    public void setAnnualInspectionDate(Date annualInspectionDate) {
        this.annualInspectionDate = annualInspectionDate;
    }

    /**
     * @param drivingLicense the drivingLicense to set
     */
    public void setDrivingLicense(String drivingLicense) {
        this.drivingLicense = drivingLicense;
    }

    /**
     * @param drivingLicenseCopy the drivingLicenseCopy to set
     */
    public void setDrivingLicenseCopy(String drivingLicenseCopy) {
        this.drivingLicenseCopy = drivingLicenseCopy;
    }

    /**
     * @param vehiclePhoto the vehiclePhoto to set
     */
    public void setVehiclePhoto(String vehiclePhoto) {
        this.vehiclePhoto = vehiclePhoto;
    }

    /**
     * @param vehicleContact the vehicleContact to set
     */
    public void setVehicleContact(String vehicleContact) {
        this.vehicleContact = vehicleContact;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(AuditStatus status) {
        this.status = status;
    }

    /**
     * @param vehicleStatus the vehicleStatus to set
     */
    public void setVehicleStatus(VehicleStatus vehicleStatus) {
        this.vehicleStatus = vehicleStatus;
    }

    /**
     * @param declareTime the declareTime to set
     */
    public void setDeclareTime(Date declareTime) {
        this.declareTime = declareTime;
    }

    /**
     * @param declareStatus the declareStatus to set
     */
    public void setDeclareStatus(DeclareStatus declareStatus) {
        this.declareStatus = declareStatus;
    }

    /**
     * @param rejectReason the rejectReason to set
     */
    public void setRejectReason(String rejectReason) {
        this.rejectReason = rejectReason;
    }

    /**
     * @param synchronize the synchronize to set
     */
    public void setSynchronize(boolean synchronize) {
        this.synchronize = synchronize;
    }

    /**
     * @param bind the bind to set
     */
    public void setBind(boolean bind) {
        this.bind = bind;
    }

    /**
     * @param vamId the vamId to set
     */
    public void setVamId(Long vamId) {
        this.vamId = vamId;
    }

    /**
     * @param assetStatus the assetStatus to set
     */
    public void setAssetStatus(AssetStatus assetStatus) {
        this.assetStatus = assetStatus;
    }

    /**
     * @param vam the vam to set
     */
    public void setVam(boolean vam) {
        this.vam = vam;
    }

    /**
     * @param creator the creator to set
     */
    public void setCreator(Long creator) {
        this.creator = creator;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param lastOperator the lastOperator to set
     */
    public void setLastOperator(Long lastOperator) {
        this.lastOperator = lastOperator;
    }

    /**
     * @param lastModifyTime the lastModifyTime to set
     */
    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }
    
}